/**
* \file TCPSocket.h
* \brief TCPSocket decleration class
* \author Edouard ROGE
* \date 12 Novembre 2013
*/
#ifndef _TCPSOCKET_
#define _TCPSOCKET_

#include "Network.h"
#include "Core/Network/ITCPSocket.h"
#include "Core/Memory/HeapObject.h"

class TCPSocket : public Core::Network::ITCPSocket, public Core::Memory::HeapObject
{
public:

	/**
	* \fn TCPSocket();
	* \brief Default contructor
	*/
	TCPSocket();

	/**
	* \fn virtual ~TCPSocket();
	* \brief Destructor
	*/
	virtual ~TCPSocket();

	/**
	* \fn virtual void Close();
	* \brief Close socket
	*/
	NETWORK_WIN32 virtual void Close();

	/**
	* \fn virtual void Send(void * _pBuffer, uint32 _iSize);
	* \brief Send data through the socket
	*/
	NETWORK_WIN32 virtual void Send(void * _pBuffer, uint32 _iSize);

	/**
	* \fn virtual void Receive(void * _pBuffer, uint32 _iSize);
	* \brief Receive data through the socket
	*/
	NETWORK_WIN32 virtual void Receive(void * _pBuffer, uint32 _iSize);

	/**
	* \fn void Connect();
	* \brief Connect to another socket
	*/
	NETWORK_WIN32 virtual void Connect(const std::string & _strAddress, uint32 _iPort);

private:

	/** Socket descriptor, we use the socket features through it */
	int32 m_iDescriptor;

	friend class TCPServerSocket;
};


#endif // _TCPSOCKET_
